﻿<%@ Page Language="VB" MasterPageFile="~/masterpages/MaestraEstado.master" AutoEventWireup="false" CodeFile="_ubicaciones.aspx.vb" Inherits="Registro_ubicaciones" title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
<link href="../Estilos/formulario.css" rel="Stylesheet" type="text/css" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
<div class ="editar">
    <div class="formulario">
    <center><h3>
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
               
        Asignación de ubicaciones</h3></center>
        <table width="400px" align="center">
            <tr>
                <td class ="FormHeaderTD" align="center" width="100px">BUSCAR:</td>
                <td align="center" class="DataTD" width="100px">
                    <asp:TextBox ID="txtAnimalBuscar" runat="server" Text="T123C1980" 
                        CssClass="text" Width="90px"></asp:TextBox>
                </td>
                <td class="DataTD" width="18px">
                    <asp:ImageButton ID="imgBtnBuscar" runat="server" 
                        ImageUrl="~/images/icon-find.png" />
                </td>
                <td class="FormHeader">
                    <asp:Label ID="lblResUbicacion" runat="server"></asp:Label>
                </td>
            </tr>
        </table>
    <br />
        <asp:UpdatePanel ID="upMovimientos" runat="server">
        <ContentTemplate>
        <table style="font-size: 0.7em;" width="920px" align="center">
            <tr>
                <td align="center" colspan="2">
                    &nbsp;</td>
                <td align="center" colspan="2" valign="middle">
                    </td>
                <td align="right" colspan="2" valign="top">
                    
                    <asp:DropDownList ID="ddlDestino" runat="server" AppendDataBoundItems="True" 
                        DataSourceID="odsCatalogoCorrales" DataTextField="catnom" 
                        DataValueField="catcve" ToolTip="Selecciona la ubicación">
                        <asp:ListItem Selected="True"></asp:ListItem>
                    </asp:DropDownList>
                    
                &nbsp;&nbsp;
                    
                    <asp:Button ID="btnMover" runat="server" CssClass="botones" Text="Mover" />
                    </td>
                <td align="center" colspan="2" valign="middle">
                    
                    <asp:Label ID="lblError" runat="server" CssClass="MaskedEditFocus" 
                        Font-Bold="True" Font-Size="13px"></asp:Label>
                    &nbsp; &nbsp;
                                        
                </td>
            </tr>
            <tr>
                <td align="center" class="FormHeaderTD" colspan="2">
                    UBICACION 1</td>
                <td align="center" class="FormHeaderTD" colspan="2">
                    UBICACION 2</td>
                <td align="center" class="FormHeaderTD" colspan="2">
                    UBICACION 3</td>
                <td align="center" class="FormHeaderTD" colspan="2">
                    UBICACION 4</td>
            </tr>
            <tr>
                <td class="DataTD">
                    <asp:DropDownList ID="ddlUbicacion1" runat="server" AppendDataBoundItems="True" 
                        AutoPostBack="True" DataSourceID="odsCatalogoCorrales" DataTextField="catnom" 
                        DataValueField="catcve" ToolTip="Selecciona la ubicación">
                        <asp:ListItem Selected="True"></asp:ListItem>
                    </asp:DropDownList>
                </td>
                <td class="FormHeader2">
                    <asp:RadioButton ID="rbActivo1" runat="server" GroupName="grid" Text="Activo" 
                        ForeColor="White" />
                </td>
                <td class="DataTD">
                    <asp:DropDownList ID="ddlUbicacion2" runat="server" AppendDataBoundItems="True" 
                        AutoPostBack="True" DataSourceID="odsCatalogoCorrales" DataTextField="catnom" 
                        DataValueField="catcve" ToolTip="Selecciona la ubicación">
                        <asp:ListItem Selected="True"></asp:ListItem>
                    </asp:DropDownList>
                </td>
                <td class="FormHeader2">
                    <asp:RadioButton ID="rbActivo2" runat="server" GroupName="grid" Text="Activo" 
                        ForeColor="White" />
                </td>
                <td class="DataTD">
                    <asp:DropDownList ID="ddlUbicacion3" runat="server" AppendDataBoundItems="True" 
                        AutoPostBack="True" DataSourceID="odsCatalogoCorrales" DataTextField="catnom" 
                        DataValueField="catcve" ToolTip="Selecciona la ubicación">
                        <asp:ListItem Selected="True"></asp:ListItem>
                    </asp:DropDownList>
                </td>
                <td class="FormHeader2">
                    <asp:RadioButton ID="rbActivo3" runat="server" GroupName="grid" Text="Activo" 
                        ForeColor="White" />
                </td>
                <td class="DataTD">
                    <asp:DropDownList ID="ddlUbicacion4" runat="server" AppendDataBoundItems="True" 
                        AutoPostBack="True" DataSourceID="odsCatalogoCorrales" DataTextField="catnom" 
                        DataValueField="catcve" ToolTip="Selecciona la ubicación">
                        <asp:ListItem Selected="True"></asp:ListItem>
                    </asp:DropDownList>
                </td>
                <td class="FormHeader2">
                    <asp:RadioButton ID="rbActivo4" runat="server" GroupName="grid" Text="Activo" 
                        ForeColor="White" />
                </td>
            </tr>
            <tr>
                <td colspan="2" valign="top">
                    <asp:GridView ID="gvCorral1" runat="server" AutoGenerateColumns="False" 
                        DataKeyNames="AnimalId" DataSourceID="odsUbicacion1" EnableTheming="True" 
                        SkinID="Gridview">
                        <Columns>
                            <asp:TemplateField HeaderText="">
                                <HeaderTemplate>
                                    <asp:CheckBox ID="chkSelectAll1" runat="server" AutoPostBack="True" 
                                        oncheckedchanged="chkSelectAll1_CheckedChanged"  />
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <asp:CheckBox ID="chkItemSelect1" runat="server" AutoPostBack="True" 
                                        oncheckedchanged="chkItemSelect1_CheckedChanged"  />
                                </ItemTemplate>
                                <EditItemTemplate>
                                </EditItemTemplate>
                            </asp:TemplateField>
                            <asp:CommandField ButtonType="Image" CancelImageUrl="~/images/cancel.png" 
                                EditImageUrl="~/images/editar.gif" ShowEditButton="True" 
                                UpdateImageUrl="~/images/check14x13_blue.png" />
                            <asp:BoundField DataField="clave" HeaderText="Animal" ReadOnly="True" 
                                SortExpression="clave" />
                            <asp:BoundField DataField="nombre" HeaderText="Nombre" ReadOnly="True" 
                                SortExpression="nombre" />
                            <asp:TemplateField SortExpression="ubicacion">
                               <EditItemTemplate>
                                    <asp:DropDownList ID="ddlMover1" runat="server" 
                                        DataSourceID="odsCatalogoCorrales" DataTextField="catnom" 
                                        DataValueField="catcve" SelectedValue='<%# Bind("ubicacion") %>' 
                                        ToolTip="Selecciona la ubicación">
                                        <asp:ListItem></asp:ListItem>
                                    </asp:DropDownList>
                                </EditItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                        <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
    <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
    <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
    <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
    <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
    <EditRowStyle BackColor="White" />
    <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                    </asp:GridView>
                </td>
                <td colspan="2" valign="top">
                    <asp:GridView ID="gvCorral2" runat="server" AutoGenerateColumns="False" 
                        CellPadding="2" DataKeyNames="AnimalId" DataSourceID="odsUbicacion2" 
                        GridLines="None" BackColor="White" BorderColor="#999999" 
                        BorderStyle="None" CellSpacing="2">
                        <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                        <Columns>
                            <asp:TemplateField HeaderText="">
                                <HeaderTemplate>
                                    <asp:CheckBox ID="chkSelectAll2" runat="server" AutoPostBack="True" 
                                        oncheckedchanged="chkSelectAll2_CheckedChanged" />
                                </HeaderTemplate>
                                <EditItemTemplate>
                                </EditItemTemplate>
                                <ItemTemplate>
                                    <asp:CheckBox ID="chkItemSelect2" runat="server" AutoPostBack="True" 
                                        oncheckedchanged="chkItemSelect2_CheckedChanged" />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:CommandField ButtonType="Image" CancelImageUrl="~/images/cancel.png" 
                                EditImageUrl="~/images/editar.gif" ShowEditButton="True" 
                                UpdateImageUrl="~/images/check14x13_blue.png" />
                            <asp:BoundField DataField="clave" HeaderText="Animal" ReadOnly="True" 
                                SortExpression="clave" />
                            <asp:BoundField DataField="nombre" HeaderText="Nombre" ReadOnly="True" 
                                SortExpression="nombre" />
                            <asp:TemplateField SortExpression="ubicacion">
                               <EditItemTemplate>
                                    <asp:DropDownList ID="ddlMover2" runat="server" 
                                        DataSourceID="odsCatalogoCorrales" DataTextField="catnom" 
                                        DataValueField="catcve" SelectedValue='<%# Bind("ubicacion") %>' 
                                        ToolTip="Selecciona la ubicación">
                                        <asp:ListItem></asp:ListItem>
                                    </asp:DropDownList>
                                </EditItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                        <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                        <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                        <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                        <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                        <EditRowStyle BackColor="White" />
                        <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                    </asp:GridView>
                </td>
                <td colspan="2" valign="top">
                    <asp:GridView ID="gvCorral3" runat="server" AutoGenerateColumns="False" 
                        CellPadding="2" DataKeyNames="AnimalId" DataSourceID="odsUbicacion3" 
                        GridLines="None" BackColor="White" BorderColor="#999999" 
                        BorderStyle="None" CellSpacing="2">
                        <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                        <Columns>
                            <asp:TemplateField HeaderText="">
                                <HeaderTemplate>
                                    <asp:CheckBox ID="chkSelectAll3" runat="server" AutoPostBack="True" 
                                        oncheckedchanged="chkSelectAll3_CheckedChanged" />
                                </HeaderTemplate>
                                <EditItemTemplate>
                                </EditItemTemplate>
                                <ItemTemplate>
                                    <asp:CheckBox ID="chkItemSelect3" runat="server" AutoPostBack="True" 
                                        oncheckedchanged="chkItemSelect3_CheckedChanged" />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:CommandField ButtonType="Image" CancelImageUrl="~/images/cancel.png" 
                                EditImageUrl="~/images/editar.gif" ShowEditButton="True" 
                                UpdateImageUrl="~/images/check14x13_blue.png" />
                            <asp:BoundField DataField="clave" HeaderText="Animal" ReadOnly="True" 
                                SortExpression="clave" />
                            <asp:BoundField DataField="nombre" HeaderText="Nombre" ReadOnly="True" 
                                SortExpression="nombre" />
                            <asp:TemplateField SortExpression="ubicacion">
                               <EditItemTemplate>
                                    <asp:DropDownList ID="ddlMover3" runat="server" 
                                        DataSourceID="odsCatalogoCorrales" DataTextField="catnom" 
                                        DataValueField="catcve" SelectedValue='<%# Bind("ubicacion") %>' 
                                        ToolTip="Selecciona la ubicación">
                                        <asp:ListItem></asp:ListItem>
                                    </asp:DropDownList>
                                </EditItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                        <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                        <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                        <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                        <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                        <EditRowStyle BackColor="White" />
                        <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                    </asp:GridView>
                </td>
                <td colspan="2" valign="top">
                    <asp:GridView ID="gvCorral4" runat="server" AutoGenerateColumns="False" 
                        CellPadding="2" DataKeyNames="AnimalId" DataSourceID="odsUbicacion4" 
                        GridLines="None" BackColor="White" BorderColor="#999999" 
                        BorderStyle="None" CellSpacing="2">
                        <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                        <Columns>
                            <asp:TemplateField HeaderText="">
                                <HeaderTemplate>
                                    <asp:CheckBox ID="chkSelectAll4" runat="server" AutoPostBack="True" 
                                        oncheckedchanged="chkSelectAll4_CheckedChanged"  />
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <asp:CheckBox ID="chkItemSelect4" runat="server" AutoPostBack="True" 
                                        oncheckedchanged="chkItemSelect4_CheckedChanged"  />
                                </ItemTemplate>
                                <EditItemTemplate>
                                </EditItemTemplate>
                            </asp:TemplateField>
                            <asp:CommandField ButtonType="Image" CancelImageUrl="~/images/cancel.png" 
                                EditImageUrl="~/images/editar.gif" ShowEditButton="True" 
                                UpdateImageUrl="~/images/check14x13_blue.png" />
                            <asp:BoundField DataField="clave" HeaderText="Animal" ReadOnly="True" 
                                SortExpression="clave" />
                            <asp:BoundField DataField="nombre" HeaderText="Nombre" ReadOnly="True" 
                                SortExpression="nombre" />
                            <asp:TemplateField SortExpression="ubicacion">
                               <EditItemTemplate>
                                    <asp:DropDownList ID="ddlMover4" runat="server" 
                                        DataSourceID="odsCatalogoCorrales" DataTextField="catnom" 
                                        DataValueField="catcve" SelectedValue='<%# Bind("ubicacion") %>' 
                                        ToolTip="Selecciona la ubicación">
                                        <asp:ListItem></asp:ListItem>
                                    </asp:DropDownList>
                                </EditItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                        <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                        <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                        <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                        <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                        <EditRowStyle BackColor="White" />
                        <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                    </asp:GridView>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <asp:ObjectDataSource ID="odsUbicacion1" runat="server" DeleteMethod="Delete" 
                        InsertMethod="Insert" OldValuesParameterFormatString="original_{0}" 
                        SelectMethod="GetAnimalesByUbicacion" 
                        TypeName="Tom0014TableAdapters.ubicacionTableAdapter" UpdateMethod="Update">
                        <DeleteParameters>
                            <asp:Parameter Name="Original_AnimalId" Type="Int32" />
                        </DeleteParameters>
                        <UpdateParameters>
                            <asp:Parameter Name="ubicacion" Type="String" />
                            <asp:Parameter Name="Original_AnimalId" Type="Int32" />
                        </UpdateParameters>
                        <SelectParameters>
                            <asp:ControlParameter ControlID="ddlUbicacion1" Name="ubicacion" 
                                PropertyName="SelectedValue" Type="String" />
                        </SelectParameters>
                        <InsertParameters>
                            <asp:Parameter Name="sexo" Type="String" />
                            <asp:Parameter Name="numero" Type="Int32" />
                            <asp:Parameter Name="letra" Type="String" />
                            <asp:Parameter Name="ano" Type="Int32" />
                            <asp:Parameter Name="nombre" Type="String" />
                            <asp:Parameter Name="ubicacion" Type="String" />
                        </InsertParameters>
                    </asp:ObjectDataSource>
                </td>
                <td colspan="2">
                    <asp:ObjectDataSource ID="odsUbicacion2" runat="server" DeleteMethod="Delete" 
                        InsertMethod="Insert" OldValuesParameterFormatString="original_{0}" 
                        SelectMethod="GetAnimalesByUbicacion" 
                        TypeName="Tom0014TableAdapters.ubicacionTableAdapter" 
                        UpdateMethod="Update">
                        <DeleteParameters>
                            <asp:Parameter Name="Original_AnimalId" Type="Int32" />
                        </DeleteParameters>
                        <UpdateParameters>
                            <asp:Parameter Name="ubicacion" Type="String" />
                            <asp:Parameter Name="Original_AnimalId" Type="Int32" />
                        </UpdateParameters>
                        <SelectParameters>
                            <asp:ControlParameter ControlID="ddlUbicacion2" Name="ubicacion" 
                                PropertyName="SelectedValue" Type="String" />
                        </SelectParameters>
                        <InsertParameters>
                            <asp:Parameter Name="sexo" Type="String" />
                            <asp:Parameter Name="numero" Type="Int32" />
                            <asp:Parameter Name="letra" Type="String" />
                            <asp:Parameter Name="ano" Type="Int32" />
                            <asp:Parameter Name="nombre" Type="String" />
                            <asp:Parameter Name="ubicacion" Type="String" />
                        </InsertParameters>
                    </asp:ObjectDataSource>
                </td>
                <td colspan="2">
                    <asp:ObjectDataSource ID="odsUbicacion3" runat="server" DeleteMethod="Delete" 
                        InsertMethod="Insert" OldValuesParameterFormatString="original_{0}" 
                        SelectMethod="GetAnimalesByUbicacion" 
                        TypeName="Tom0014TableAdapters.ubicacionTableAdapter" 
                        UpdateMethod="Update">
                        <DeleteParameters>
                            <asp:Parameter Name="Original_AnimalId" Type="Int32" />
                        </DeleteParameters>
                        <UpdateParameters>
                            <asp:Parameter Name="ubicacion" Type="String" />
                            <asp:Parameter Name="Original_AnimalId" Type="Int32" />
                        </UpdateParameters>
                        <SelectParameters>
                            <asp:ControlParameter ControlID="ddlUbicacion3" Name="ubicacion" 
                                PropertyName="SelectedValue" Type="String" />
                        </SelectParameters>
                        <InsertParameters>
                            <asp:Parameter Name="sexo" Type="String" />
                            <asp:Parameter Name="numero" Type="Int32" />
                            <asp:Parameter Name="letra" Type="String" />
                            <asp:Parameter Name="ano" Type="Int32" />
                            <asp:Parameter Name="nombre" Type="String" />
                            <asp:Parameter Name="ubicacion" Type="String" />
                        </InsertParameters>
                    </asp:ObjectDataSource>
                </td>
                <td colspan="2">
                    <asp:ObjectDataSource ID="odsUbicacion4" runat="server" DeleteMethod="Delete" 
                        InsertMethod="Insert" OldValuesParameterFormatString="original_{0}" 
                        SelectMethod="GetAnimalesByUbicacion" 
                        TypeName="Tom0014TableAdapters.ubicacionTableAdapter" 
                        UpdateMethod="Update">
                        <DeleteParameters>
                            <asp:Parameter Name="Original_AnimalId" Type="Int32" />
                        </DeleteParameters>
                        <UpdateParameters>
                            <asp:Parameter Name="ubicacion" Type="String" />
                            <asp:Parameter Name="Original_AnimalId" Type="Int32" />
                        </UpdateParameters>
                        <SelectParameters>
                            <asp:ControlParameter ControlID="ddlUbicacion4" Name="ubicacion" 
                                PropertyName="SelectedValue" Type="String" />
                        </SelectParameters>
                        <InsertParameters>
                            <asp:Parameter Name="sexo" Type="String" />
                            <asp:Parameter Name="numero" Type="Int32" />
                            <asp:Parameter Name="letra" Type="String" />
                            <asp:Parameter Name="ano" Type="Int32" />
                            <asp:Parameter Name="nombre" Type="String" />
                            <asp:Parameter Name="ubicacion" Type="String" />
                        </InsertParameters>
                    </asp:ObjectDataSource>
                </td>
            </tr>
        </table>
        <p>&nbsp;<asp:ObjectDataSource ID="odsCatalogoCorrales" runat="server" 
            OldValuesParameterFormatString="original_{0}" SelectMethod="GetCatalogoByTipo" 
            TypeName="Tom0014TableAdapters.catalogo_generalTableAdapter">
        <SelectParameters>
            <asp:Parameter DefaultValue="U" Name="cattip" Type="String" />
        </SelectParameters>
        </asp:ObjectDataSource>
    </p>
        </ContentTemplate>
        </asp:UpdatePanel>
        
    </div>
</div>
</asp:Content>

